<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link type="text/css" href="../static/login/css/login.css" th:href="@{/login/css/login.css}" rel="stylesheet"/>
</head>
<body>
<!-- particles.js container -->
<div id="particles-js" style="display: flex;align-items: center;justify-content: center">
</div>
<div class="login-page">
    <div class="login-content">
        <div class="login-tit">登录</div>
        <div class="login-input">
            <input id="userName" required="" type="text" placeholder="用户名/手机号">
        </div>
        <div class="login-input">
            <input id="password" type="password" placeholder="密码">
        </div>
        <div class="login-btn">
            <div class="login-btn-left" onclick="doLogin();">
                <span>登录</span>
            </div>
            <!--<div class="login-btn-right" onClick="changeImg()">
                <img src="img/check.png" alt="" id="picture"> 记住密码
            </div>-->
        </div>
    </div>
</div>
</body>

<script src="../static/jquery/jquery.min.js" th:src="@{/jquery/jquery.min.js}" ></script>
<script src="../static/login/js/particles.js" th:src="@{/login/js/particles.js}" ></script>
<script src="../static/login/js/app.js" th:src="@{/login/js/app.js}" ></script>
<script th:inline="javascript"> var ctx = [[@{/}]]; var captchaType = [[${captchaType}]]; </script>
<script type="text/javascript">
    function doLogin() {
        var userName = $('#userName').val();
        var password = $('#password').val();
        $.ajax({
            type: "post",
            async: false,
            url: ctx+"back/dologin?userName=" + userName + "&password=" + password + "&" + "t=" + Math.random(),
            dataType: "json",
            success: function (data) {
                if (data.code == 500) {
                    alert(data.msg);
                } else {
                    window.location.href = ctx+"back/index";
                }
            },

            error: function (XMLHttpRequest, textStatus, errorThrown) {

            }
        });
    }


</script>
</html>
